package cs;

import java.time.LocalDate;
import java.time.LocalTime;

public class Reservation {
    private MeetingRoom meetingRoom; // 关联的会议室
    private LocalDate date; // 预订日期
    private LocalTime startTime; // 开始时间
    private LocalTime endTime; // 结束时间

    public Reservation(MeetingRoom meetingRoom, LocalDate date, LocalTime startTime, LocalTime endTime) {
        this.meetingRoom = meetingRoom;
        this.date = date;
        this.startTime = startTime;
        this.endTime = endTime;
    }

    public MeetingRoom getMeetingRoom() {
        return meetingRoom;
    }

    public LocalDate getDate() {
        return date;
    }

    public LocalTime getStartTime() {
        return startTime;
    }

    public LocalTime getEndTime() {
        return endTime;
    }

    @Override
    public String toString() {
        return String.format("预定信息: 会议室=%s, 日期=%s, 时间段=%s-%s",
                meetingRoom.getName(), date, startTime, endTime);
    }
}
